package com.tcxr.framework.base;

import javax.servlet.http.HttpSession;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;

import com.tcxr.framework.system.Variables;

public class ServerBase {
	
	protected   final Logger logger = LoggerFactory.getLogger(getClass());
	
	
	protected  HttpSession  getSession()
	{
//		HttpServletRequest request =  ((ServletRequestAttributes)RequestContextHolder.getRequestAttributes()).getRequest();
//		request.getSession().setAttribute(name, value)
	 return	((ServletRequestAttributes)RequestContextHolder.getRequestAttributes()).getRequest().getSession();
	}
	
protected void  setSessionUser(Object value)
{
	 this.getSession().setAttribute(Variables.SESSION_USER, value);
}

protected Object  getSessionUser()
{
	return  this.getSession().getAttribute(Variables.SESSION_USER);
}

 




}
